//
//  NetworkAPI.h
//  MengTianXia
//
//  Created by zl on 2019/8/10.
//  Copyright © 2019 qttx. All rights reserved.
// 项目的网络请求接口统一放在此处

#import <Foundation/Foundation.h>
#import "HttpRequest.h"
#import "NetworkHeader.h"
#import "BWSecurities.h"

NS_ASSUME_NONNULL_BEGIN

@interface NetworkManager : NSObject
#pragma mark - 参数验签处理
/// 拼接请求参数字典
/// @param module 接口模块名
/// @param interface 接口编码
/// @param dataDict 请求参数
+ (NSDictionary *)setupParamsDictWithModule:(NSString *)module interface:(NSString *)interface dataDict:(NSDictionary *_Nullable)dataDict;

/// 数组转为json字符串
+ (NSString *)arrayToJSONString:(NSArray *)array;


#pragma mark - 网络请求

/// 网络请求方法
/// @param path 网络地址路径
/// @param module Module字段
/// @param interface Interface字段
/// @param parameterDict 其他参数
/// @param showLoading 是否显示等待视图
/// @param success 成功回调
/// @param failure 失败回调
+ (void)requestWithUrlPath:(NSString *)path module:(NSString *_Nonnull)module interface:(NSString *_Nonnull)interface parameterDict:(nullable NSDictionary *)parameterDict showLoading:(BOOL)showLoading success:(nullable SuccessBlock)success failure:(nullable FailureBlock)failure;

/// portal模块网络请求方法
+ (void)requestWithModule:(NSString *_Nonnull)module interface:(NSString *_Nonnull)interface parameterDict:(nullable NSDictionary *)parameterDict showLoading:(BOOL)showLoading success:(nullable SuccessBlock)success failure:(nullable FailureBlock)failure;

/// Shop模块网络请求方法
+ (void)shopRequestWithModule:(NSString *_Nonnull)module interface:(NSString *_Nonnull)interface parameterDict:(nullable NSDictionary *)parameterDict showLoading:(BOOL)showLoading success:(nullable SuccessBlock)success failure:(nullable FailureBlock)failure;



@end

NS_ASSUME_NONNULL_END
